package simple.utils.bitmaps;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: rehak
 * Date: 9/26/13
 * Time: 9:21 AM
 * To change this template use File | Settings | File Templates.
 */
public interface Bitmap {

    public void set(int position);

    public boolean get(int position);

    /**
     * Get array of indexes set in bitmap
     *
     * @return
     */
    public int[] toArray();

    public byte[] toBytes() throws IOException;

    public Bitmap readOnly();

    public Bitmap and(Bitmap other);

    /**
     * Position of latest set bit
     *
     * @return
     */
    int length();

    /**
     * Number of bits set
     *
     * @return
     */
    int cardinality();

    /**
     * Outputs this Bitmap to uncompressed byte array
     *
     * @return
     */
    byte[] toUncompressedByteArray();
}
